package com.chinasoft.maysham.manager.service.user;

import com.chinasoft.maysham.manager.model.User;
import com.chinasoft.maysham.manager.request.UserRegisterReq;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface UserService extends UserDetailsService {

    /**
     * 用户注册
     *
     * @param registerReq registerReq
     * @param userId      userId
     * @return result
     */
    User register(UserRegisterReq registerReq, String userId);

    /**
     * 查询全局用户信息
     *
     * @param page    page
     * @param size    size
     * @param keyword keyword
     * @param userId  userId
     * @return result
     */
    List<User> list(int page, int size, String keyword, String userId);

    /**
     * 注销用户
     *
     * @param userId userId
     * @param opId   opId
     * @return result
     */
    Boolean unRegister(String userId, String opId);

    /**
     * 更新用户基本信息
     *
     * @param userId        userId
     * @param registerReq   registerReq
     * @param currentUserId currentUserId
     * @return result
     */
    User update(String userId, UserRegisterReq registerReq, String currentUserId);

    /**
     * 用户登录
     *
     * @param username username
     * @param password password
     * @return result
     */
    User login(String username, String password);
}
